import numpy as np;

np.set_printoptions(precision=16, sign='-', floatmode='fixed');

# LRGBtoXYZ65 = np.array([
# 	[ 0.4123907992659593, 0.357584339383878, 0.1804807884018343 ],
# 	[ 0.2126390058715102, 0.715168678767756, 0.0721923153607337 ],
# 	[ 0.0193308187155918, 0.119194779794626, 0.9505321522496607] 
# ]);

LRGBtoXYZ65 = np.array([
	[ 506752 / 1228815,  87881 / 245763,   12673 /   70218 ],
	[  87098 /  409605, 175762 / 245763,   12673 /  175545 ],
	[   7918 /  409605,  87881 / 737289, 1001167 / 1053270 ],
]);

XYZ65toLMS = np.array([
	[ 0.8190224379967030, 0.3619062600528904, -0.1288737815209879 ],
	[ 0.0329836539323885, 0.9292868615863434,  0.0361446663506424 ],
	[ 0.0481771893596242, 0.2642395317527308,  0.6335478284694309 ]
]);

LMStoOKLab = np.array([
	[ 0.2104542683093140,  0.7936177747023054, -0.0040720430116193 ],
	[ 1.9779985324311684, -2.4285922420485799,  0.4505937096174110 ],
	[ 0.0259040424655478,  0.7827717124575296, -0.8086757549230774 ]
]);

C = np.matmul(XYZ65toLMS, LRGBtoXYZ65);
Cinv = np.linalg.inv(C);

print(C);
print(Cinv);